home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Nave / goobers.swf / scripts / frame_92 / PlaceObject2_68_63 / CLIPACTIONRECORD onClipEvent(enterFrame).as next >
Encoding:
Text File  |  2007-03-28  |  917 b   |  42 lines

  1. onClipEvent(enterFrame){
  2.    if(status == "alive")
  3.    {
  4.       if(0 >= health)
  5.       {
  6.          this.gotoAndPlay(_parent.num_levels + 1);
  7.          status = "dead";
  8.       }
  9.       num_frames_shoot = Math.floor(health / 3.5) + 10;
  10.       if(frame % num_frames_shoot == 0)
  11.       {
  12.          _parent.enemy_bullet.duplicateMovieClip("enemy_bullet" + depth,depth);
  13.          _parent["enemy_bullet" + depth].x = this._x;
  14.          _parent["enemy_bullet" + depth].y = this._y;
  15.          depth++;
  16.       }
  17.       frame++;
  18.       if(frame % num_frames_x == 0)
  19.       {
  20.          x += velx;
  21.       }
  22.       if(right < x)
  23.       {
  24.          x = right;
  25.          velx *= -1;
  26.          y += vely;
  27.       }
  28.       else if(x < left)
  29.       {
  30.          x = left;
  31.          velx *= -1;
  32.          y += vely;
  33.       }
  34.       if(bottom < y)
  35.       {
  36.          y = start_y;
  37.       }
  38.       this._x = x;
  39.       this._y = y;
  40.    }
  41. }
  42.